#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 5, MOD = 1e9 + 7;

struct mat
{
	LL m[N][N];

	mat()
	{ 
		memset(m, 0, sizeof m);
	}

	mat operator*(const mat& B)
	{
		mat C;
		for(int i = 1;i <= 2;i ++)
			for(int j = 1;j <= 2;j ++)
				for(int k = 1;k <= 2;k ++)
					C.m[i][j] = (C.m[i][j] + m[i][k] * B.m[k][j]) % MOD;
		return C;
	}
}A, ret;

void qpow(LL b)
{
	A.m[1][1] = A.m[1][2] = A.m[2][1] = 1;
	ret.m[1][1] = ret.m[1][2] = 1;
	while(b)
	{
		if(b & 1) ret = ret * A;
		A = A * A;
		b >>= 1;
	}
}

int main()
{
	LL n; cin >> n;
	if(n == 1 || n == 2) cout << 1 << endl;
	else
	{
		qpow(n - 2);
		cout << ret.m[1][1] << endl;
	}
	return 0;
}